class Comment < ActiveRecord::Base
	
	has_and_belongs_to_many :teacher
	has_many :opinion
	has_many :ip_shake
	has_many:tag
	attr_reader :min_shakes=>4
    
    def self.approbed(offset,limits_per_page)
    
        find (:all, :conditions=>["shakes>=?",min_shakes],:offset =>offset,:limit  => limits_per_page)


    end

    def self.top_rated(offset,limits_per_page)
        
        
        #find (:all, :conditions=>["shakes=?",min_shakes],:offset =>offset,:limit  =>  items_per_page,:order =>'shakes' )
   
        
    end

    def self.in_schedule(offset,limits_per_page)
        
            find (:all, :conditions=>["shakes<?",min_shakes],:offset =>offset,:limit  =>  items_per_page )
   
        
    end    
	
end
